package org.langqiao.string;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class UnicodeToString {
	public static void main(String[] args){
		String str ="\u655E\u8F66;\u5355\u673A;\u5C0F\u8D27\u8F66;\u91D1\u676F\u8F66;\u90AE\u653F\u8F66;\u53A2\u5F0F\u8F66;\u6302\u8F66;\u534A\u6302\u8F66;\u5355\u6865\u8F66;\u53CC\u6865\u8F66;\u4E09\u6865\u8F66;\u9AD8\u62A4\u680F;\u4F4E\u62A4\u680F;\u9AD8\u4F4E\u677F;\u4F4E\u5E95\u76D8;\u5E73\u677F\u8F66;\u524D\u56DB\u540E\u56DB;\u524D\u56DB\u540E\u516B;\u540E\u516B\u8F6E;\u7F50\u8F66;\u62D6\u677F\u8F66;\u4FDD\u6E29\u8F66;\u51B7\u85CF\u8F66;\u81EA\u5378;\u5C01\u95ED\u8F66;\u534A\u5C01\u95ED\u8F66;\u68C9\u88AB\u8F66;\u96C6\u88C5\u7BB1;\u65AF\u592A\u5C14;\u53C9\u8F66;\u540A\u8F66;\u8F7F\u8F66\u4E13\u7528\u8F66;\u56DE\u7A0B;";
		UnicodeToString.unicode_string(str);
		
	}
	public static String unicode_string(String str){
		Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
		Matcher matcher = pattern.matcher(str);
		char ch;
		while(matcher.find()){
			ch = (char) Integer.parseInt(matcher.group(2),16);
			str = str.replace(matcher.group(1),ch+"");		
		}
		System.out.println(str);
		return str;
	}

}
